package com.hzit.controller;

import com.hzit.entity.Student;
import com.hzit.service.StudentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import sun.rmi.runtime.Log;

/**
 * 类名：
 * 作者：WF
 * 功能：
 */
@Controller
@RequestMapping("/user")
@Slf4j
public class UserController {
	@Autowired
	private StudentService studentService;

	//1、添加用户
	@PostMapping("/add")
	public String add(String username){
		log.info("用户名[POSt]：{}",username);
		return "index";
	}
	//2、添加用户
	@GetMapping("/findById")
	public String findById(String username){
		log.info("用户名[GET]：{}",username);
		return "index";
	}
	//3、修改用户
	@PutMapping("/update")
	public String update(String username){
		log.info("用户名[PUT]：{}",username);
		return "index";
	}
	//4、删除用户
	@DeleteMapping("/delete")
	public String delete(String username){
		log.info("用户名[DELETE]：{}",username);
		return "index";
	}
	//2. 默认表单页面
	@GetMapping("/index")
	public String index(){
		return "index";
	}
}
